package com.feng.fengmall.auth2.test;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;


public class Md5 {
    public static void main(String[] args) {
        //使用BCryptPasswordEncoder加密
        BCryptPasswordEncoder passwordEncoder=new BCryptPasswordEncoder();
        String encode = passwordEncoder.encode("123456");
        System.out.println("123456加密后："+encode);
        //解密
        boolean matches = passwordEncoder.matches("123456", encode);
        System.out.println("密码是否匹配："+matches);
    }
}
